package de.karlNet.sambamanager.ldapModel;

import java.util.HashSet;
import java.util.Set;

import de.karlNet.login.Useraccountcontrol;

public class LdapUser extends LdapNestable implements ITypeChecker {
	private String firstname = "";
	private String lastname = "";
	private String username = "";
	private String password = "";
	private Set<Useraccountcontrol> useraccountcontrols = new HashSet<Useraccountcontrol>();

	public void setUseraccountcontrols(Set<Useraccountcontrol> useraccountcontrols) {
		this.useraccountcontrols = useraccountcontrols;
	}

	public Set<Useraccountcontrol> getUseraccountcontrols() {
		return useraccountcontrols;
	}

	public LdapUser() {
		this.useraccountcontrols.add(Useraccountcontrol.NORMAL_ACCOUNT);
	}

	public LdapUser(String cn, String dn, String username, String firstname,
			String lastname, Set<Useraccountcontrol> useraccountcontrols) {
		super(cn, dn);
		this.username = username;
		this.firstname = firstname;
		this.lastname = lastname;
		this.useraccountcontrols = useraccountcontrols;
		this.useraccountcontrols.add(Useraccountcontrol.NORMAL_ACCOUNT);
	}

	public String getFirstname() {
		return firstname;
	}

	public String getLastname() {
		return lastname;
	}

	public String getPassword() {
		return password;
	}

	public String getUsername() {
		return username;
	}

	public void setFirstname(String firstname) {
		this.firstname = firstname;
	}

	public void setLastname(String lastname) {
		this.lastname = lastname;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	@Override
	public String toString() {
		return "LdapUser [username=" + username + ", firstname=" + firstname
				+ ", lastname=" + lastname + "]";
	}

	@Override
	public void isType(ITypeCheckerCallback typeCheckerCallback) {
		typeCheckerCallback.isUser();
		typeCheckerCallback.isUser(this);
	}

}
